﻿using System;
using Microsoft.AspNetCore.Mvc;
using studentSubsidy.Entity;
using studentSubsidy.Entity.AdminProject;
using studentSubsidy.Service;

namespace studentSubsidy.Controllers
{
    [ApiController]
    [Route("api/adminApply/[Action]")]
    public class AdminApply :Controller
    {
        private AdminApplyService _adminApplyService = new AdminApplyService();
        
        [HttpGet(Name = "checkSuccess")]
        public Result CheckSuccess([FromQuery] int apply_id,string role)
        {
            return _adminApplyService.checkSuccess(apply_id,role);
        }
        
        
        [HttpPost(Name = "getAllApplyCheck")]
        public Result GetAllApplyCheck([FromQuery] string role)
        {
            return _adminApplyService.getAllApplyCheck(role);
        }
        
        [HttpPost(Name = "rejectApply")]
        public Result RejectApply([FromBody] RejectQuery roleRejectQuery)
        {
            return _adminApplyService.rejectApply(roleRejectQuery);
        }
        
        [HttpPost(Name = "getAllRejectApply")]
        public Result GetAllRejectApply([FromQuery] string role)
        {
            return _adminApplyService.getAllRejectApply(role);
        }
    }
}